package com.dream.testtubebaby.adapter;

import java.util.List;

import android.content.Context;
import android.widget.ImageView;

import com.dream.testtubebaby.R;
import com.dream.testtubebaby.data.product.CarRentalListItemData;
import com.dream.testtubebaby.utils.AppUtil;
import com.dream.testtubebaby.utils.ImageLoader;
import com.dream.testtubebaby.utils.ViewHolder;

public class ProductViewCarRentalAdapter extends ProductListBaseAdapter<CarRentalListItemData> {

	public ProductViewCarRentalAdapter(Context context,
			List<CarRentalListItemData> mDatas, int itemLayoutId) {
		super(context, mDatas, itemLayoutId);
	}

	@Override
	public void convert(ViewHolder helper, CarRentalListItemData item) {
		helper.setText(R.id.carrental_view_name, item.getName());
		if(item.getPics() != null && item.getPics().length > 0){
			String url = item.getPics()[0];
			String url1 = AppUtil.getCompletePhotoUrl(url);
			ImageLoader.getInstance().loadLookupNetworkImage(url1, (ImageView)helper.getView(R.id.carrental_view_img));
		}else{
//			((ImageView)helper.getView(R.id.carrental_image)).setImageResource(R.drawable.detail_show_3);
		}
	}

}
